package linkwechat.util;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class ResponseUtil {

    public static void ResWriter(HttpServletRequest request, HttpServletResponse response,Object object) throws IOException {
        response.setContentType("application/json;charset=UTF-8");
        PrintWriter writer = response.getWriter();
//        writer.write(JSON.toJSONString(object));
        writer.print(JSON.toJSONString(object));
        writer.flush();
        writer.close();
    }

}
